package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.QuotaManage;
import com.dhcc.DRGsHosp.facade.dto.QuotaManageDTO;

public class QuotaManageAssembler {
	
	public static QuotaManageDTO  toDTO(QuotaManage  quotaManage){
		if (quotaManage == null) {
			return null;
		}
    	QuotaManageDTO result  = new QuotaManageDTO();
    		result.setQmId (quotaManage.getQmId());
 	    	result.setParquotaCode (quotaManage.getParquotaCode());
 	    	result.setParDepCode (quotaManage.getParDepCode());
 	    	result.setPardrgCode (quotaManage.getPardrgCode());
 	    	result.setManageYear (quotaManage.getManageYear());
 	    	result.setManageBenchmark (quotaManage.getManageBenchmark());
 	    	result.setParDepGroupCode (quotaManage.getParDepGroupCode());
 	    	result.setParPatientType(quotaManage.getParPatientType());
 	    	result.setParMsCode(quotaManage.getParMsCode());
     	    return result;
	 }
	
	public static List<QuotaManageDTO>  toDTOs(Collection<QuotaManage>  quotaManages){
		if (quotaManages == null) {
			return null;
		}
		List<QuotaManageDTO> results = new ArrayList<QuotaManageDTO>();
		for (QuotaManage each : quotaManages) {
			results.add(toDTO(each));
		}
		return results;
	}
	
	 public static QuotaManage  toEntity(QuotaManageDTO  quotaManageDTO){
	 	if (quotaManageDTO == null) {
			return null;
		}
	 	QuotaManage result  = new QuotaManage();
         result.setQmId (quotaManageDTO.getQmId());
         result.setParquotaCode (quotaManageDTO.getParquotaCode());
         result.setParDepCode (quotaManageDTO.getParDepCode());
         result.setPardrgCode (quotaManageDTO.getPardrgCode());
         result.setManageBenchmark (quotaManageDTO.getManageBenchmark());
         result.setParDepGroupCode (quotaManageDTO.getParDepGroupCode());
         result.setManageYear(quotaManageDTO.getManageYear());
         result.setParPatientType(quotaManageDTO.getParPatientType());
         result.setParMsCode(quotaManageDTO.getParMsCode()) ;
 	  	return result;
	 }
	
	public static List<QuotaManage> toEntities(Collection<QuotaManageDTO> quotaManageDTOs) {
		if (quotaManageDTOs == null) {
			return null;
		}
		
		List<QuotaManage> results = new ArrayList<QuotaManage>();
		for (QuotaManageDTO each : quotaManageDTOs) {
			results.add(toEntity(each));
		}
		return results;
	}
}
